package com.gzy.xuexiziliao.mapper;

import com.gzy.xuexiziliao.pojo.entity.Doctor;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Mapper
public interface DoctorMapper {
    @Insert("INSERT INTO doctor(doctorname, gender, specialization, status, phone, image,appointment) " +
            "VALUES(#{doctorName}, #{gender}, #{specialization}, #{status}, #{phone}, #{image},#{appointment})")
    void save(Doctor doctor);

    void delete(List<Integer> ids);

    void update(Doctor doctor);

    @Select("select * from doctor where doctor_id = #{doctorId}")
    Doctor getById(Integer id);

    List<Doctor> list(String name, Short gender, LocalDate begin, LocalDate end);

    Integer countByMap(Map map);

    List<Doctor> getByName(String name);

    void cancel(Doctor doctorinfo);

    List<Doctor> appointmentlist(int appointment, LocalDate begin, LocalDate end);
}
